package cn.cmcc.online.smsapi.ui.web;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.http.SslError;
import android.webkit.ConsoleMessage;
import android.webkit.GeolocationPermissions.Callback;
import android.webkit.JsResult;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;

import java.util.Map;

public interface IActivityForWebView {
    WebView getWebView();

    Activity getActivity();

    Intent getIntent();

    int checkOrientation();

    boolean shouldOverrideUrlLoading(WebView view, String url);

    void onProgressChanged(WebView view, int newProgress);

    void onPageStarted(WebView view, String url, Bitmap favicon);

    void onPageFinished(WebView view, String url);

    void onReceivedError(WebView view, int errorCode, String description, String failingUrl);

    void showError(int errorCode, Map<String, Object> extend);

    void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype,
                         long contentLength);

    void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error);

    void setEndUrl(String url);

    void requestWebViewLoad(String pageViewUrl);

    void requestWebViewLoad(String pageViewUrl, Map<String, String> header);

    boolean onJsAlert(WebView view, String url, String message, JsResult result);

    boolean onJsConfirm(WebView view, String url, String message, JsResult result);

    boolean onConsoleMessage(ConsoleMessage cm);

    void onGeolocationPermissionsShowPrompt(String origin, Callback callback);

    void onConsoleMessage(String message, int lineNumber, String sourceID);

    void onReceivedTitle(WebView view, String title);

}
